package controller;

import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.Controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Author:shixiaojun@itany.com
 * Date:2022/3/10 11:36
 * Version:1.0-SNAPSHOT
 */
public class HelloController implements Controller {
    @Override
    public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) throws Exception {
        ModelAndView mav = new ModelAndView();
//        ModelMap map = new ModelMap();
//        map.addAttribute("key","value");
//        request.setAttribute("key","value");
        mav.addObject("msg","Hello World");
        mav.setViewName("hello");
        return mav;
    }
}
